<nav class="navbar navbar-cmcm navbar-fixed-top">
  <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#">{$app_name}后台</a>
  </div>
  <div id="navbar" class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
      <li><a href="{:U('Users/index')}" ahref="Users">用户管理</a></li>
      <li><a href="{:U('Orders/index')}" ahref="Orders">订单管理</a></li>
      <li><a href="{:U('Products/index')}" ahref="Products">商品管理</a></li>
      <li><a href="{:U('Statistics/index')}" ahref="Statistics">店铺统计</a></li>
      <li><a href="{:U('Shops/index')}" ahref="Shops">商家管理</a></li>
      <li><a href="{:U('Apps/xcx_edit')}" ahref="Apps">系统管理</a></li>
    </ul>
    <ul class="nav navbar-nav navbar-right">
      <present name="msgs">
        <li class="dropdown msg">
          <a href="javascript:;" class="dropdown-toogle" data-toggle="dropdown"><span class="wi wi-bell"><if condition="$msgs.count gt 0"><span class="badge">{$msgs.count}条</span></if></span>消息</a>
          <div class="dropdown-menu">
            <div class="clearfix top">消息
              <!--<a href="{:U('message/notice')}" class="pull-right">查看更多</a>--></div>
            <div class="msg-list-container">
              <div class="msg-list">
                <volist name="msgs.list" id="vo">
                  <div class="item">
                    <div class="info clearifx">
                      <div class="pull-right date">{$vo.created_at}</div>
                      来自 <span>{$vo.types_str}</span>
                    </div>
                    <div class="msg-content">
                      <a href="{$vo.url}">{$vo.content}</a>
                    </div>
                  </div>
                </volist>
              </div>
            </div>
          </div>
        </li>
      </present>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img class="nav-avatar" src="__PUBLIC__/myadmin/images/logo.png">{$admin_info.name} <span class="caret"></span></a>
        <ul class="dropdown-menu">
          <!--<li><a href="{:U('Users/index')}">用户信息</a></li>-->
          <li><a href="/web/index.php?c=wxapp&a=version&do=home">返回小程序</a></li>
        </ul>
      </li>
    </ul>
  </div>
</nav>

<script type="text/javascript">
  $(document).ready(function() {
    var href = location.href;
    var ahref;
    $("#navbar").find("li").removeClass('active');
    $("#navbar").find("li").each(function() {
      ahref = $(this).find('a').attr('ahref');
      if (href.indexOf(ahref) > -1) {
        $(this).addClass('active');
      }
    });
  });
</script>